<%@ page import="aiball.Gamecharts" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'gamecharts.label', default: 'Gamecharts')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-gamecharts" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>

			</ul>
		</div>
		<div id="list-gamecharts" class="content scaffold-list" role="main">
			<h1>Spielergebnisse - Saison ${params.date}</h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<br>
			<table>
				<thead>
					<tr>
						<th></th>
						<th>Heim</th>
						<th>Gast</th>
						<th>Tore Heim</th>
						<th>Tore Gast</th>
						<th>Halbzeit-Tore Heim</th>
						<th>Halbzeit-Tore Gast</th>
					</tr>
				</thead>
				<tbody>
				<g:each in="${gamechartsInstanceList}" status="i" var="gamechartsInstance">
					<g:if test="${gamechartsInstance.time.toString() == (params.date + " 00:00:00.0") && gamechartsInstance?.team1Goals != -1}">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
						<td><g:link action="show" id="${gamechartsInstance.id}">Spiel ansehen..</g:link></td>
						<td>${gamechartsInstance?.team1?.name.encodeAsHTML()}</td>
						<td>${gamechartsInstance?.team2?.name.encodeAsHTML()}</td>
						<td>${fieldValue(bean: gamechartsInstance, field: "team1Goals")}</td>
						<td>${fieldValue(bean: gamechartsInstance, field: "team2Goals")}</td>
						<td>${fieldValue(bean: gamechartsInstance, field: "team1GoalsHalfTime")}</td>
						<td>${fieldValue(bean: gamechartsInstance, field: "team2GoalsHalfTime")}</td>
					</tr>
					</g:if>
				</g:each>

				</tbody>
			</table>
		</div>
	</body>
</html>
